/* Wall3D.h
 * A class to handle functions needed identify and detect walls
 * Inherits IGameManager, IObject and IWall
 */

#pragma once

#include "GameStd.h"
#include <OgreVector3.h>

class Wall3D : public IWall
{
public:
    Wall3D();
    Wall3D(Ogre::Vector3 A, Ogre::Vector3 B, Ogre::Vector3 C, Ogre::Vector3 D);
    ~Wall3D();

	//Inherited from IWall
    Ogre::Vector3 From();
    void SetFrom(Ogre::Vector3 nA);
    Ogre::Vector3 To();
    void SetTo(Ogre::Vector3 nB);
    Ogre::Vector3 Height();
    void SetHeight(Ogre::Vector3 nC);
	Ogre::Vector3 Width();
	void SetWidth(Ogre::Vector3 nD);
    Ogre::Vector3 Normal();
    void SetNormal(Ogre::Vector3 nN);
    Ogre::Vector3 GetCenter();
		

	//Inherited from IObject
	void Draw(){};
	bool HandleMessage(int message){return false;};
	Ogre::Vector3 GetPosition(){return Ogre::Vector3::ZERO;};
	void SetPostion(Ogre::Vector3 pos){};
	double GetBRadius(){return 0.0;};
	void SetBRadius(double r){};
	int GetID();
	void SetID(int id);
	bool IsTagged(){return false;};
	void Tag(){};
	void UnTag(){};
	Ogre::Vector3 GetScale(){return Ogre::Vector3::ZERO;};
	void SetScale(Ogre::Vector3 nScale){};
	void SetScale(double nScale){};
	ObjectType GetObjectType();
	void SetObjectType(ObjectType nType);
	void Write(std::ostream& os){};
	void Read(std::istream& is){};
	double TimeElapsed(){return 0.0;};
	void SetName(Ogre::String nName);
	Ogre::String GetName();


    //Inherited from IGameManager
    void Initialize();
    void UpdateStarted(const Ogre::FrameEvent& gameTime);
    void UpdateEnded(const Ogre::FrameEvent& gameTime);
    void Cleanup();

private:
	void CalculateNormal();

    Ogre::Vector3 m_A;              //Point a : where the wall start
    Ogre::Vector3 m_B;              //Point b : where the wall ends
    Ogre::Vector3 m_C;              //Point c : the height of the wall
	Ogre::Vector3 m_D;				//Point d : the width of the wall
    Ogre::Vector3 m_N;              //n : the normal vector

    int m_ID;                       //Unique, assigned by ObjectManager
    Ogre::String m_Name;			//Unique name assigned by ObjectManager
	ObjectType m_ObjectType;		//ObjectType WALL

};

